<?php
	include_once("checkAuthenticationAction.php");
	include_once("../util/constant.php");	
    include_once("../service/branchService.php");
    $title = $_POST["branchTitle"];
    $order = $_POST["order"];
	$address = $_POST["address"];
	if(createBranch($title,$order,$address)){
		$newId = mysql_insert_id();
		echo "<script>window.location.href='../admin/branch-detail.php?action=".INSERT_SUCCESSFULLY."&id=".$newId."';</script>";
	}else{
		echo "<script>window.location.href='../admin/branch-detail.php?action=".INSERT_FAILED."';</script>";
	}
?>